<!doctype html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<html>
<head>
<meta charset="utf-8">

<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/global.css">
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/layout.css">
<link rel="stylesheet" type="text/css" href="${basePath }commonCss/css/easyui.css">
<script src="${basePath }commonJs/jquery.min.js"></script>
<script src="${basePath }commonJs/jquery.easyui.min.js"></script>
<script src="${basePath }commonJs/jt_normal.js"></script>
<script src="${basePath }commonJs/jt_select.js"></script>
<script language="javascript" src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>

<script src="${basePath }commonJs/promotion/wolf_common.js"></script>
<script src="${basePath }commonJs/promotion/wolf_validation.js"></script>
<title>嘉童游乐中心-库存调整</title>
</head>
<script type="text/javascript">
jQuery(document).ready(function(){
	defultLoad();
});
/**
 * 首页数据加载
 */
function defultLoad(){
	var form = $("#user_home_form"); 
    var pagebean = new PageBean(form);
    pagebean.setTableId("user_home_table");
    pagebean.setCallback(defultLoadCall);
    pagebean.setFootId("user_home_page");
    setPagebeanObj(pagebean); 
    pagebean.doPage();
}
function defultLoadCall(data){
	if(wolf.isNotNull(data)){
		wolf.data_foreach(data, function(i,obj){
			var userId = obj.pkUsrId;
			var roleN = (obj.roleName==null?"-":obj.roleName.substr(0,6)+"...");
			var roleTitle = (obj.roleName==null?"":obj.roleName);
			
			var tr = "<tr>"+
			        	"<td>"+(i+1)+"</td>"+
			            "<td>"+obj.branName+"</td>"+
			            "<td class=\"lv\"><a href=\"${basePath}authority/user/editUserPage.shtml?userId="+userId+"\">"+obj.usrName+"</a></td>"+
			            "<td>"+obj.loginId+"</td>"+
			            "<td title='"+roleTitle+"'>"+roleN+"</td>"+
			            "<td>"+(obj.email==null?"-":obj.email)+"</td>"+
			            "<td>"+(obj.phone==null?"-":obj.phone)+"</td>"+
			            "<td><input type=\"button\" value=\"重置登录密码\" class=\"btn_l\" onclick=\"resetPass('"+userId+"')\"> &nbsp; "+
			            	"<input type=\"button\" value=\"删除\" class=\"btn_l\"  onclick=\"deleteUser('"+userId+"')\"></td>"+
			        "</tr>";
		    $("#user_home_table").append(tr);
		});
	}
}
function deleteUser(userId){
	$.messager.confirm('提示', '你确定要删除吗?', function(r) {
		if (r) {
			$.ajax({ 
				url: "${basePath }authority/user/deleteUser.shtml",
				data:"userId="+userId,
				dataType: 'json',
				type:'POST',
				success: function(data){
					defultLoad();
		      	}
			});
		}
	});
	
}
function resetPass(userId){
	$.ajax({ 
		url: "${basePath }authority/user/resetPass.shtml",
		data:"userId="+userId,
		dataType: 'json',
		type:'POST',
		success: function(data){
			if(data == 0){
				alertInfo("重置密码失败,请刷新后重试！");
			}else if(data == 1){
				alertInfo("操作成功！");
			}
      	}
	});
}

</script>
<body class="bg">
<div class="content m_auto">
	<div class="content_l mt10">
    	<ul>
    	<shiro:hasPermission name="authority/role/home.shtml">
         <li ><a href="${basePath}authority/role/home.shtml"><i class="nav_icon_u"></i><br>角色管理</a></li>
           </shiro:hasPermission>
           <shiro:hasPermission name="authority/user/home.shtml">
            <li class="content_hover"><a href="${basePath}authority/user/home.shtml"><i class="nav_icon_t"></i><br>用户管理</a></li>
           </shiro:hasPermission>
           <shiro:hasPermission name="SalesRelation/mem.shtml">
            <li><a href="${basePath}SalesRelation/mem.shtml"><i class="nav_icon_s"></i><br>销售关联会员</a></li>
            </shiro:hasPermission>
            <shiro:hasPermission name="ParRoomDetail/ParRoom.shtml">
            <li ><a href="${basePath}ParRoomDetail/ParRoom.shtml"><i class="nav_icon_r"></i><br>房间管理</a></li>
           </shiro:hasPermission>
           <shiro:hasPermission name="SysBarCode/system.shtml">
            <li><a href="${basePath }SysBarCode/system.shtml"><i class="nav_icon_q"></i><br>条码维护</a></li>
            </shiro:hasPermission>
            <shiro:hasPermission name="WfmAuthorize/toShenP.shtml">
            <li><a href="${basePath}WfmAuthorize/toShenP.shtml"><i class="nav_icon_s"></i><br>审批转授权</a></li>
            </shiro:hasPermission>
            <shiro:hasPermission name="holiday/sysHoliday.shtml">
            <li><a href="${basePath}holiday/sysHoliday.shtml"><i class="nav_icon_q"></i><br>节假日管理</a></li>
            </shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10">
    	<!---- 内容 --->
        <div class="p20">
        <form action="${basePath }/authority/user/seacheLikeUser.shtml" id="user_home_form">
	        <div class="file_single_dl">
	        	<dl>
	            	<dd><label>所属门店：</label>
	                	<!----select--->
	                    <div class="uboxstyle">
	                        <select name="branId" id="branId">
	                            <c:forEach items="${branAll }" var="bran"  varStatus="cc">
                           			<c:choose>
	                            		<c:when test="${branId == 'ZB' }">
	                            			<c:if test="${bran.pkBranId !='ZB'}">
	                            				<option value="${bran.pkBranId}">${bran.branName }</option>
	                            			</c:if>
	                            			<c:if test="${bran.pkBranId =='ZB'}">
	                            				<option value="${bran.pkBranId}">${bran.branName }</option>
	                            				<option value="" selected>全部</option>
	                            				
	                            			</c:if>
		                            	</c:when>
		                            	<c:when test="${branId != 'ZB' && branId ==bran.pkBranId }">
		                            		
		                            		<option value="${bran.pkBranId}">${bran.branName }</option>
		                            	</c:when>
		                            	
                            		</c:choose>
	                            </c:forEach>
	                        </select>
	                    </div>
	                    <!----select--->
	                </dd>
	                <dd><label>用户姓名：</label><input type="text" class="iput_t w200" name="usrName"></dd>
	                <dd><label>登录账号：</label><input type="text" class="iput_t w200"  name="loginId"></dd>
	                <dd><label>邮箱：</label><input type="text" class="iput_t w200"  name="email"></dd>
	                <dd><label>联系电话：</label><input type="text" class="iput_t w200"  name="phone"></dd>
	                <dd>
	                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		                <input type="button" class="btn ml10" value="新增" onClick="javascript:window.location.href='${basePath}authority/user/addUserPage.shtml'">
		                <input type="button" class="btn " value="查询" onclick="defultLoad()">
	                </dd>
	            </dl>
	        </div>
	        <input type="hidden" name="pageNo" value="1">
	        <input type="hidden" name="pageSize" value="10">
        </form>
        
        <table class="table" id="user_home_table">
        	<tr>
            	<th>序号</th>
                <th>所属门店</th>
                <th>用户姓名</th>
                <th>账号</th>
                <th>角色</th>
                <th>邮箱</th>
                <th>联系电话</th>
                <th>操作</th>
            </tr>
           <!--  <tr>
            	<td>1</td>
                <td>总部</td>
                <td class="lv"><a href="system_yonh_x.html">tank</a></td>
                <td>903443</td>
                <td>运营总监</td>
                <td>9090@sina.cn</td>
                <td>1293049222</td>
                <td><input type="button" value="删除" class="btn_l"></td>
            </tr>
            <tr>
            	<td>2</td>
                <td>总部</td>
                <td class="lv"><a href="system_yonh_x.html">tank</a></td>
                <td>903443</td>
                <td>运营总监</td>
                <td>9090@sina.cn</td>
                <td>1293049222</td>
                <td><input type="button" value="删除" class="btn_l"></td>
            </tr> -->
        </table>
        <!----翻页----->
        
        <div class="page fr m10" id="user_home_page">
            <span>第3/2000页</span>
            <span>首页</span>
            <span>上一页</span>
            <span><a href="#">下一页</a></span>
            <span><a href="#">末页</a></span>
            <span>跳转到<input type="text" class="black_text mlr5">页</span>
        </div>
        <!----翻页----->
        </div>
        <!---- 内容 --->
    </div>
</div>


</body>
</html>
